/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package podologia.beansDB;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author Hernan
 */
@Entity
@Table(name = "caracteristicadedo")
@NamedQueries({@NamedQuery(name = "Caracteristicadedo.findByIdCaracteristicaDedo", query = "SELECT c FROM Caracteristicadedo c WHERE c.idCaracteristicaDedo = :idCaracteristicaDedo"), @NamedQuery(name = "Caracteristicadedo.findByNombre", query = "SELECT c FROM Caracteristicadedo c WHERE c.nombre = :nombre"), @NamedQuery(name = "Caracteristicadedo.findByDescripcion", query = "SELECT c FROM Caracteristicadedo c WHERE c.descripcion = :descripcion")})
public class Caracteristicadedo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy=GenerationType.SEQUENCE)
    @Column(name = "idCaracteristicaDedo", nullable = false)
    private Integer idCaracteristicaDedo;
    @Column(name = "nombre")
    private String nombre;
    @Column(name = "descripcion")
    private String descripcion;
    @OneToMany(mappedBy = "idCarDedo")
    private Collection<Cardedoxatencion> cardedoxatencionCollection;

    public Caracteristicadedo() {
    }

    public Caracteristicadedo(Integer idCaracteristicaDedo) {
        this.idCaracteristicaDedo = idCaracteristicaDedo;
    }

    public Integer getIdCaracteristicaDedo() {
        return idCaracteristicaDedo;
    }

    public void setIdCaracteristicaDedo(Integer idCaracteristicaDedo) {
        this.idCaracteristicaDedo = idCaracteristicaDedo;
    }

    public String getNombre() {
        return nombre;
    }

    public void setNombre(String nombre) {
        this.nombre = nombre;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public Collection<Cardedoxatencion> getCardedoxatencionCollection() {
        return cardedoxatencionCollection;
    }

    public void setCardedoxatencionCollection(Collection<Cardedoxatencion> cardedoxatencionCollection) {
        this.cardedoxatencionCollection = cardedoxatencionCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idCaracteristicaDedo != null ? idCaracteristicaDedo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Caracteristicadedo)) {
            return false;
        }
        Caracteristicadedo other = (Caracteristicadedo) object;
        if ((this.idCaracteristicaDedo == null && other.idCaracteristicaDedo != null) || (this.idCaracteristicaDedo != null && !this.idCaracteristicaDedo.equals(other.idCaracteristicaDedo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return nombre;
    }

}
